home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / AIncludes / HardwareEqu.a < prev    next >
Encoding:
Text File  |  1993-12-02  |  40.8 KB  |  1,052 lines  |  [TEXT/MPS ]

  1. ;    File:        HardwareEqu.a
  2. ;
  3. ;    Copyright:    © 1983-1993 by Apple Computer, Inc.
  4. ;                All rights reserved.
  5. ;
  6. ;    Version:    System 7.1 for ETO #11
  7. ;    Created:    Tuesday, March 30, 1993 18:00
  8. ;
  9. ;___________________________________________________________________________
  10.  
  11.     IF &TYPE('__INCLUDINGHARDWAREEQU__') = 'UNDEFINED' THEN
  12. __INCLUDINGHARDWAREEQU__    SET    1
  13.  
  14.  
  15.                   IF          (&TYPE('onMac') = 'UNDEFINED') THEN 
  16. onMac             EQU         0
  17.                   ENDIF
  18.  
  19.                   IF          (&TYPE('onMacPP') = 'UNDEFINED') THEN
  20. onMacPP           EQU         0
  21.                   ENDIF
  22.  
  23.                   IF          (&TYPE('onNuMac') = 'UNDEFINED') THEN
  24. onNuMac           EQU         0
  25.                   ENDIF
  26.  
  27.                   IF          (&TYPE('onHafMac') = 'UNDEFINED') THEN
  28. onHafMac           EQU         0
  29.                   ENDIF
  30.  
  31.                   IF          (&TYPE('onHcMac') = 'UNDEFINED') THEN
  32. onHcMac           EQU         0
  33.                   ENDIF
  34.  
  35.                   IF          (&TYPE('onMac16') = 'UNDEFINED') THEN
  36. onMac16           EQU         0
  37.                   ENDIF
  38.  
  39.                   IF          (&TYPE('onMac32') = 'UNDEFINED') THEN
  40. onMac32           EQU         0
  41.                   ENDIF
  42.  
  43. onAnything        EQU         onMac|onMacPP|onHcMac|onHafMac|onNuMac
  44.  
  45.  
  46. ; *** If HWNonPortable is defined to be non-zero, Then a machine type must be specified!
  47. ; *** If a machine is specified, HWNonPortable must be non-zero, specified or not.
  48.                   IF          (&TYPE('HWNonPortable') = 'UNDEFINED') THEN
  49. HWNonPortable     EQU         onAnything
  50.                   ENDIF
  51.  
  52.                   IF          HWNonPortable THEN
  53.  
  54. ;----------
  55. ; Hardware configuration bits.
  56. ;----------
  57.  
  58. ;the following goes with hwCfgFlags 
  59.  
  60. hwCbSCSI          EQU         15                        ; SCSI port present
  61. hwCbClock         EQU         14                        ; New clock chip present
  62. hwCbExPRAM        EQU         13                        ; Extra Parameter Ram valid.
  63. hwCbFPU           EQU         12                        ; FPU chip present.
  64. hwCbMMU           EQU         11                        ; Some kind of MMU present (see MMUType for what kind).
  65. hwCbADB           EQU         10                        ; Apple Desktop Bus present.
  66. hwCbAUX            EQU            9                        ; Running A/UX                    <2.8>
  67. hwCbPwrMgr        EQU            8                        ; Power Manager present            <2.8>
  68. hwCmSCSI          EQU         (1 << hwCbSCSI)
  69. hwCmClock         EQU         (1 << hwCbClock)
  70. hwCmExPRAM        EQU         (1 << hwCbExPRAM)
  71. hwCmFPU           EQU         (1 << hwCbFPU)
  72. hwCmMMU           EQU         (1 << hwCbMMU)
  73. hwCmADB           EQU         (1 << hwCbADB)
  74. hwCmAUX            EQU            (1 << hwCbAUX)
  75. hwCmPwrMgr        EQU            (1 << hwCbPwrMgr)
  76.  
  77.  
  78.  
  79. ;----------
  80. ; 6522 VIA offsets
  81. ;----------
  82.  
  83. vBufB             EQU         0                         ; BUFFER B
  84. vBufAH            EQU         $200                      ; buffer a (with handshake) [ Dont use! ]
  85. vDIRB             EQU         $400                      ; DIRECTION B
  86. vDIRA             EQU         $600                      ; DIRECTION A
  87. vT1C              EQU         $800                      ; TIMER 1 COUNTER (L.O.)
  88. vT1CH             EQU         $A00                      ; timer 1 counter (high order)
  89. vT1L              EQU         $C00                      ; TIMER 1 LATCH (L.O.)
  90. vT1LH             EQU         $E00                      ; timer 1 latch (high order)
  91. vT2C              EQU         $1000                     ; TIMER 2 LATCH (L.O.)
  92. vT2CH             EQU         $1200                     ; timer 2 counter (high order)
  93. vSR               EQU         $1400                     ; SHIFT REGISTER
  94. vACR              EQU         $1600                     ; AUX. CONTROL REG.
  95. vPCR              EQU         $1800                     ; PERIPH. CONTROL REG.
  96. vIFR              EQU         $1A00                     ; INT. FLAG REG.
  97. vIER              EQU         $1C00                     ; INT. ENABLE REG.
  98. vBufA             EQU         $1E00                     ; BUFFER A
  99.  
  100. ; === VIA IFR/IER bits ===
  101. ifCA2             EQU         0                         ; CA2 interrupt
  102. ifCA1             EQU         1                         ; CA1 interrupt
  103. ifSR              EQU         2                         ; SR shift register done
  104. ifCB2             EQU         3                         ; CB2 interrupt
  105. ifCB1             EQU         4                         ; CB1 interrupt
  106. ifT2              EQU         5                         ; T2 timer2 interrupt
  107. ifT1              EQU         6                         ; T1 timer1 interrupt
  108. ifIRQ             EQU         7                         ; any interrupt
  109.  
  110.  
  111. ;----------
  112. ; IWM Offsets
  113. ;----------
  114.  
  115. ph0L              EQU         0                         ; disk address offsets from base
  116. ph0H              EQU         $200
  117. ph1L              EQU         $400
  118. ph1H              EQU         $600
  119. ph2L              EQU         $800
  120. ph2H              EQU         $A00
  121. ph3L              EQU         $C00
  122. ph3H              EQU         $E00
  123. mtrOff            EQU         $1000
  124. mtrOn             EQU         $1200
  125. intDrive          EQU         $1400                     ; enable internal drive address
  126. extDrive          EQU         $1600                     ; enable external drive address
  127. q6L               EQU         $1800
  128. q6H               EQU         $1A00
  129. q7L               EQU         $1C00
  130. q7H               EQU         $1E00
  131.  
  132. ;_______________________________________;            <2.5>
  133. ;
  134. ;  SWIM offsets
  135. ;_______________________________________;
  136.  
  137. wData             EQU         $0000                     ;Write a data byte
  138. wMark             EQU         $0200                     ;Write a mark byte
  139. wCRC              EQU         $0400                     ;Write a 2-byte CRC (1 access does both)
  140. wIWMConfig        EQU         wCRC                      ;Set IWM configuration
  141. wParams           EQU         $0600                     ;Set the 16 parameter registers
  142. wPhase            EQU         $0800                     ;Set phase lines states and directions
  143. wSetup            EQU         $0A00                     ;Set the current configuration
  144. wZeroes           EQU         $0C00                     ;Mode reg: 1's clr bits, 0's=don't care
  145. wOnes             EQU         $0E00                     ;Mode reg: 1's set bits, 0's=don't care
  146. rData             EQU         $1000                     ;Read a data byte
  147. rCorrection       EQU         rData                     ;Read the correction factor
  148. rMark             EQU         $1200                     ;Read a mark byte
  149. rError            EQU         $1400                     ;Error register
  150. rParams           EQU         $1600                     ;Parameters (16 bytes deep at this addr)
  151. rPhase            EQU         $1800                     ;Phase lines states and directions
  152. rSetup            EQU         $1A00                     ;Read the current configuration
  153. rStatus           EQU         $1C00                     ;Status (returns current mode reg value)
  154. rHandshake        EQU         $1E00                     ;Handshake register
  155.  
  156.  
  157. ;----------
  158. ; 8530 SCC Offsets
  159. ;----------
  160.  
  161. aData             EQU         6                         ; offset for A channel data
  162. aCtl              EQU         2                         ; offset for A channel control
  163. bData             EQU         4                         ; offset for B channel data
  164. bCtl              EQU         0                         ; offset for B channel control
  165. sccData           EQU         4                         ; general offset for data from control
  166. rxBF              EQU         0                         ; SCC receive buffer full
  167. txBE              EQU         2                         ; SCC transmit buffer empty
  168. RxCA            EQU            0                        ; Receive Character Available            <5>
  169.  
  170. ;----------
  171. ; SCC Clock Rates, Baud Rate Constants
  172. ;----------
  173.  
  174. macClock          EQU         36707                     ; in Hz * 100
  175. hcMacClock        EQU         36720                     ; SCC clock rates
  176. midMacClock       EQU         39168
  177. nuMacClock        EQU         36864
  178. lisaAClock        EQU         40000                     ; port A clock
  179. lisaBCLock        EQU         36864                     ; port B clock
  180. macConst          EQU         114709                    ; in Hz/32
  181. hcMacConst        EQU         114750
  182. midMacConst       EQU         122400
  183. nuMacConst        EQU         115200
  184. lisaAConst        EQU         125000
  185. lisaBConst        EQU         115200
  186.  
  187.  
  188. ;----------
  189. ; 53C80 SCSI Register Defs, Offsets
  190. ;----------
  191.  
  192. sCDR              EQU         $00                       ; Current SCSI Read Data
  193. sODR              EQU         $00                       ; Output data register
  194. sICR              EQU         $10                       ; Initiator Command Register - READ/WRITE
  195. iRST              EQU         $80                       ; *RST asserted
  196. iAIP              EQU         $40                       ; arbitration in progress (read)
  197. bAIP              EQU         6                         ; bit test for arbitration in progress
  198. aTMD              EQU         $40                       ; assert Test Mode (write)
  199. iLA               EQU         $20                       ; Lost arbitration (read)
  200. bLA               EQU         5                         ; bit test for Lost Arbitration
  201. aDIFF             EQU         $20                       ; assert Differential enable (write)
  202. iACK              EQU         $10                       ; *ACK is asserted
  203. iBSY              EQU         $08                       ; *BSY is asserted
  204. iSEL              EQU         $04                       ; *SEL is asserted
  205. iATN              EQU         $02                       ; *ATN is asserted
  206. iDB               EQU         $01                       ; Data bus is asserted
  207. sMR               EQU         $20                       ; Mode Register - READ/WRITE
  208. iBDMA             EQU         $80                       ; Block Mode DMA
  209. iTGT              EQU         $40                       ; Target Mode
  210. iPTY              EQU         $20                       ; Enable Parity Checking
  211. iIPTY             EQU         $10                       ; Enable Parity interrupt
  212. iIEOP             EQU         $08                       ; Enable EOP interrupt
  213. iMBSY             EQU         $04                       ; Monitor BSY
  214. iDMA              EQU         $02                       ; DMA Mode
  215. iARB              EQU         $01                       ; Arbitration
  216. sTCR              EQU         $30                       ; Target Command Register - READ/WRITE
  217. iREQ              EQU         $08                       ; Assert *REQ
  218. iMSG              EQU         $04                       ; Assert *MSG
  219. iCD               EQU         $02                       ; Assert C/*D
  220. iIO               EQU         $01                       ; Assert I/*O
  221. sCSR              EQU         $40                       ; Current SCSI Bus Status (READ)
  222. aRST              EQU         $80                       ; *RST
  223. aBSY              EQU         $40                       ; *BSY
  224. bBSY              EQU         6                         ; bit test for *BSY
  225. aREQ              EQU         $20                       ; *REQ
  226. bREQ              EQU         5                         ; bit test for *REQ
  227. aMSG              EQU         $10                       ; *MSG
  228. bMSG              EQU         4                         ; bit test for *MSG
  229. aCD               EQU         $08                       ; C/*D
  230. bCD               EQU         3                         ; bit test for C/*D
  231. aIO               EQU         $04                       ; I/*O
  232. bIO               EQU         2                         ; bit test for I/*O
  233. aSEL              EQU         $02                       ; *SEL
  234. bSEL              EQU         1                         ; bit test for *SEL
  235. aDBP              EQU         $01                       ; *DBP
  236. sSER              EQU         $40                       ; Select Enable Register (WRITE)
  237. sBSR              EQU         $50                       ; Bus & Status Register (READ)
  238. iEDMA             EQU         $80                       ; End of DMA
  239. bEDMA             EQU         7                         ; bit test for end of DMA
  240. iDMAR             EQU         $40                       ; DMA Request
  241. bDMAR             EQU         6                         ; bit test for DMA Req
  242. iPERR             EQU         $20                       ; Parity Error
  243. iIREQ             EQU         $10                       ; Interrupt Request
  244. bIREQ             EQU         4                         ; bit test for interrupt
  245. iPM               EQU         $08                       ; Phase Match
  246. bPM               EQU         3                         ; bit test for Phase Match
  247. iBERR             EQU         $04                       ; Bus Error
  248. ATN               EQU         $02                       ; *ATN
  249. ACK               EQU         $01                       ; *ACK
  250. bACK              EQU         0                         ; bit test for ACK
  251. sDMAtx            EQU         $50                       ; DMA Transmit Start (WRITE)
  252. sIDR              EQU         $60                       ; Data input register (READ)
  253. sTDMArx           EQU         $60                       ; Start Target DMA receive (WRITE)
  254. sRESET            EQU         $70                       ; Reset Parity/Interrupt (READ)
  255. sIDMArx           EQU         $70                       ; Start Initiator DMA receive (WRITE)
  256.  
  257.  
  258.  
  259. ;----------
  260. ; VIA2 register definitions
  261. ;----------
  262.  
  263. ; === VIA2 BUFFER A ===
  264. v2IRQ1            EQU         0                         ; slot 1 interrupt
  265. v2IRQ2            EQU         1                         ; slot 2 interrupt
  266. v2IRQ3            EQU         2                         ; slot 3 interrupt
  267. v2IRQ4            EQU         3                         ; slot 4 interrupt
  268. v2IRQ5            EQU         4                         ; slot 5 interrupt
  269. v2IRQ6            EQU         5                         ; slot 6 interrupt
  270. v2RAM0            EQU         6                         ; RAM size bit 0
  271. v2RAM1            EQU         7                         ; RAM size bit 1
  272.  
  273. ; === VIA2 BUFFER B ===
  274. v2CDis            EQU         0                         ; cache disable (when 1)    <3.3>
  275. v2BusLk           EQU         1                         ; Bus lockout
  276. v2PowerOff        EQU         2                         ; soft power off signal (when 0)
  277. vFC3              EQU         3                         ; PMMU FC3 indicator
  278. v2TM1A            EQU         4                         ; bit for NUBus
  279. v2TM0A            EQU         5                         ; and another
  280. v2SndExt          EQU         6                         ; 1 = internal speaker, 0 = ext. audio
  281. v2VBL             EQU         7                         ; pseudo VBL signal
  282.  
  283.  
  284.                   IF          onMac THEN
  285. ;=======================================;
  286. ;  Macintosh Plus Hardware Information    ;
  287. ;=======================================;
  288.  
  289. hwCfgBits         EQU         hwCmSCSI++hwCmClock
  290. machine           EQU         0
  291. rom85Bits         EQU         $7F                       ; New ROMs, No Power Off.
  292.  
  293. ; === Interrupt Masks ===
  294. hiIntMask         EQU         $0300                    ; programmer switch only
  295. sccIntMask        EQU         $0200                     ; SCC interrupt Level        <1.5>
  296. sccEnblMask       EQU         $F9FF                     ; mask to enable SCC interrupts
  297. viaIntMask        EQU         $0100                     ; mask for VIA (and VBL) interrupts
  298. loIntMask         EQU         $0100
  299.  
  300. ; === VIA1 BUFFER A ===
  301. vSound            EQU         $7                        ; sound volume bits (0..2)
  302. vSndPg2           EQU         3                         ; select sound page 2 if 0
  303. vOverlay          EQU         4                         ; overlay bit (overlay when 1)
  304. vHeadSel          EQU         5                         ; head select line for Sony
  305. vPage2            EQU         6                         ; select video page 2 if 0
  306. vSCCWrReq         EQU         7                         ; SCC write/request line
  307.  
  308. vAOut             EQU         (vSound)|\                ; sound volume bits are outputs
  309.                             (1<<vSndPg2)|\            ; sound page 2 select is an output
  310.                             (1<<vOverlay)|\            ; overlay bit is an output
  311.                             (1<<vHeadSel)|\            ; head select line is an output
  312.                             (1<<vPage2)|\            ; video page 2 select is an output
  313.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  314.  
  315. vAInit             EQU         (1)|\                    ; sound volume level initially 1
  316.                             (1<<vSndPg2)|\            ; main sound buffer selected
  317.                             (0<<vOverlay)|\            ; overlay is turned off
  318.                             (1<<vHeadSel)|\            ; head select line is an output
  319.                             (1<<vPage2)|\            ; main screen buffer selected
  320.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  321.  
  322. vBufD             EQU         vBufA                     ; disk head select is buffer A
  323.  
  324.  
  325. ; === VIA1 BUFFER B ===
  326. vRTCData          EQU         0                         ; real time clock data
  327. vRTCClk           EQU         1                         ; real time clock clock pulses
  328. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  329. vSW               EQU         3                         ; mouse switch (0 when down)
  330. vX2               EQU         4                         ; mouse X level
  331. vY2               EQU         5                         ; mouse Y level
  332. vH4               EQU         6                         ; horizontal sync
  333. vSndEnb           EQU         7                         ; /sound enable (reset when 1)
  334.  
  335. vBOut             EQU         (1<<vRTCData)|\            ; real time clock data initially an output
  336.                             (1<<vRTCClk)|\            ; real time clock clock is an output
  337.                             (1<<vRTCEnb)|\            ; clock enable is an output
  338.                             (0<<vSW)|\                ; mouse switch is an input
  339.                             (0<<vX2)|\                ; mouse X level is an input
  340.                             (0<<vY2)|\                ; mouse Y level is an input
  341.                             (0<<vH4)|\                ; horizontal sync is an input
  342.                             (1<<vSndEnb)            ; sound enable is an output
  343.  
  344. vBInit             EQU         (1<<vRTCData)|\            ; real time clock data is one
  345.                             (1<<vRTCClk)|\            ; real time clock clock is high
  346.                             (1<<vRTCEnb)|\            ; clock initially disabled
  347.                             (0<<vSW)|\                ; mouse switch is an input
  348.                             (0<<vX2)|\                ; mouse X level is an input
  349.                             (0<<vY2)|\                ; mouse Y level is an input
  350.                             (0<<vH4)|\                ; horizontal sync is an input
  351.                             (1<<vSndEnb)            ; sound is disabled
  352.  
  353. vBufM            EQU         vBufB                      ; mouse state is buffer B
  354.  
  355.  
  356. ; === Hardware Base Addresses ===
  357.  
  358. PhaseRead         EQU         $F00000                   ; Phase read address
  359.  
  360. VBase             EQU         $EFE1FE                   ; VIA base address
  361. AVBufA            EQU         VBase+vBufA             ; VIA buffer A
  362. AVBufB            EQU         VBase+vBufB              ; VIA buffer B
  363. AVBufM            EQU         VBase+vBufM              ; VIA buffer with mouse button bit
  364.  
  365. SCCRBase          EQU         $9FFFF8                   ; SCC base read address
  366. SCCWBase          EQU         $BFFFF9                   ; SCC base write address
  367. sccWrite          EQU         SCCWBase-SCCRBase        ; general offset for write from read
  368.  
  369. SCSIRd            EQU         $580000                   ; base addr SCSI interface - READ
  370. SCSIWr            EQU         $580001                   ; base addr SCSI interface - WRITE
  371. wrOffs            EQU         SCSIWr-SCSIRd            ; write addrs are +1 to the read base
  372.  
  373. SoundLow          EQU         $3FFD00                   ; sound buffer start address
  374. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  375.  
  376. PWMBuffer         EQU         $3FFD01                   ; PWM bytes are low bytes
  377. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  378.  
  379. ; === Video Parameters ===
  380.  
  381. ScreenLow         EQU         $3FA700                   ; top of screen screen address
  382. scrn2MemTop       EQU         $5900                     ; ScreenBase to Memtop
  383.  
  384. ; === System Software Information ===
  385.  
  386. bufWorldSize      EQU         scrn2MemTop               ; total size of the BufPtr world
  387. seRegs            EQU         $3FFC80                   ; Sys Error Regs w/o Overlay
  388.  
  389.                   ELSEIF      onMacPP THEN
  390. ;=======================================;
  391. ;    Macintosh SE Hardware Information    ;
  392. ;=======================================;
  393.  
  394. hwCfgBits         EQU         hwCmSCSI++hwCmClock++hwCmADB
  395. machine           EQU         2
  396. rom85Bits         EQU         $7F                       ; New ROMs, No Power Off.
  397.  
  398. ; === Interrupt Masks ===
  399. hiIntMask         EQU         $0300                    ; programmer switch only
  400. sccIntMask        EQU         $0200                     ; SCC interrupt Level        <1.5>
  401. sccEnblMask       EQU         $F9FF                     ; mask to enable SCC interrupts
  402. viaIntMask        EQU         $0100                     ; mask for VIA (and VBL) interrupts
  403. loIntMask         EQU         $0100
  404.  
  405. ; === VIA1 BUFFER A ===
  406. vSound            EQU         $7                        ; sound volume bits (0..2)
  407. vSync             EQU         3                         ; Synchronous modem
  408. vDriveSel         EQU         4                         ; int drive select (lower drive when 1)
  409. vHeadSel          EQU         5                         ; head select line for Sony
  410. vPage2            EQU         6                         ; select video page 2 if 0
  411. vSCCWrReq         EQU         7                         ; SCC write/request line
  412.  
  413. vAOut             EQU         (vSound)|\                ; sound volume bits are outputs
  414.                             (1<<vSync)|\            ; Synchronous modem is an output
  415.                             (1<<vDriveSel)|\        ; int drive select is an output
  416.                             (1<<vHeadSel)|\            ; head select line is an output
  417.                             (1<<vPage2)|\            ; video page 2 select is an output
  418.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  419.  
  420. vAInit             EQU         (1)|\                    ; sound volume level initially 1
  421.                             (1<<vSync)|\            ; Synchronous modem disabled (active low)
  422.                             (0<<vDriveSel)|\        ; upper floppy drive selected
  423.                             (1<<vHeadSel)|\            ; head select line is an output
  424.                             (1<<vPage2)|\            ; main screen buffer selected
  425.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  426.  
  427. vBufD             EQU         vBufA                     ; disk head select is buffer A
  428.  
  429.  
  430. ; === VIA1 BUFFER B ===
  431. vRTCData          EQU         0                         ; real time clock data
  432. vRTCClk           EQU         1                         ; real time clock clock pulses
  433. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  434. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  435. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  436. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  437. vSCSIMask         EQU         6                         ; SCSI IRQ mask
  438. vH4               EQU         vSCSIMask                ; SCSI IRQ mask (was horiz. sync)
  439. vSndEnb           EQU         7                         ; /sound enable (reset when 1)
  440.  
  441. vBOut             EQU         (1<<vRTCData)|\            ; real time clock data initially an output
  442.                             (1<<vRTCClk)|\            ; real time clock clock is an output
  443.                             (1<<vRTCEnb)|\            ; clock enable is an output
  444.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  445.                             (1<<vFDesk1)|\            ; FDB state bit 0 is an output
  446.                             (1<<vFDesk2)|\            ; FDB state bit 1 is an output
  447.                             (1<<vSCSIMask)|\        ; SCSI IRQ mask is an output
  448.                             (1<<vSndEnb)            ; sound enable is an output
  449.  
  450. vBInit             EQU         (1<<vRTCData)|\            ; real time clock data is one
  451.                             (1<<vRTCClk)|\            ; real time clock clock is high
  452.                             (1<<vRTCEnb)|\            ; clock initially disabled
  453.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  454.                             (1<<vFDesk1)|\            ; FDB state bit 0 is initially state 3
  455.                             (1<<vFDesk2)|\            ; FDB state bit 1 is initially state 3
  456.                             (1<<vSCSIMask)|\        ; SCSI IRQ mask is initially masked
  457.                             (1<<vSndEnb)            ; sound is disabled
  458.  
  459.  
  460. ; === Hardware Base Addresses ===
  461.  
  462. VBase             EQU         $EFE1FE                   ; VIA base address
  463. AVBufA            EQU         VBase+vBufA             ; VIA buffer A
  464. AVBufB            EQU         VBase+vBufB              ; VIA buffer B
  465.  
  466. SCCRBase          EQU         $9FFFF8                   ; SCC base read address
  467. SCCWBase          EQU         $BFFFF9                   ; SCC base write address
  468. sccWrite          EQU         SCCWBase-SCCRBase        ; general offset for write from read
  469.  
  470. SCSIRd            EQU         $5FF000                   ; base addr SCSI interface - READ
  471. SCSIWr            EQU         $5FF001                   ; base addr SCSI interface - WRITE
  472. MacSCSIBase       EQU         $5FF000                   ; base addr SCSI READ interface
  473. MacSCSIDMA        EQU         $5FF200                   ; base addr SCSI DMA
  474. MacSCSIHsk        EQU         $5FF200                   ; base addr SCSI handshake
  475. wrOffs            EQU         SCSIWr-SCSIRd            ; write addrs are +1 to the read base
  476.  
  477. SoundLow          EQU         $3FFD00                   ; sound buffer start address
  478. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  479.  
  480. PWMBuffer         EQU         $3FFD01                   ; PWM bytes are low bytes
  481. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  482.  
  483. ; === Video Parameters ===
  484.  
  485. ScreenLow         EQU         $3FA700                   ; top of screen screen address
  486. scrn2MemTop       EQU         $5900                     ; ScreenBase to Memtop
  487.  
  488. ; === System Software Information ===
  489.  
  490. bufWorldSize      EQU         scrn2MemTop               ; total size of the BufPtr world
  491. seRegs            EQU         $3FFC80                   ; Sys Error Regs w/o Overlay
  492.  
  493.                   ELSEIF      onHcMac THEN
  494. ;===========================================;
  495. ;    Macintosh Portable Hardware Information    ;
  496. ;===========================================;
  497.  
  498. hwCfgBits         EQU         hwCmSCSI++hwCmClock++hwCmADB++hwCbPwrMgr                ; <2.8>
  499. machine           EQU         3
  500. rom85Bits         EQU         $7F                       ; New ROMs, No Power Off.
  501.  
  502. ; === Interrupt Masks ===
  503. hiIntMask         EQU         $0300                    ; programmer switch only
  504. sccIntMask        EQU         $0200                     ; SCC interrupt Level        <1.5>
  505. sccEnblMask       EQU         $F9FF                     ; mask to enable SCC interrupts
  506. viaIntMask        EQU         $0100                     ; mask for VIA (and VBL) interrupts
  507. loIntMask         EQU         $0100
  508.  
  509. ; === VIA1 BUFFER A ===
  510.                                                     ; 68000 <-> PowerMgr data bus
  511. vAIn              EQU         $00                       ; VBufA output bits (all inputs)
  512. vAOut             EQU         $FF                       ; VBufA output bits (all outputs)
  513. vAInit            EQU         $00                       ; VBufA initial values
  514.  
  515.  
  516. ; === VIA1 BUFFER B ===
  517. vPMreq            EQU         0                         ; Power manager handshake request
  518. vPMack            EQU         1                         ; Power manager handshake acknowledge
  519. vTestJ            EQU         2                         ; Test jumper
  520. vSync             EQU         3                         ; Synchronous modem
  521. vDriveSel         EQU         4                         ; int drive select (lower drive when 1)
  522. vHeadSel          EQU         5                         ; head select line for Sony
  523. vStereo           EQU         6                         ; Stereo sound enable
  524. vSCCWrReq         EQU         7                         ; SCC write/request line        (input)
  525. vSndEnb           EQU         7                         ; /sound enable (reset when 1)    (output)
  526.  
  527. vBOut             EQU         (1<<vPMreq)|\            ; Power mgr handshake request is an output
  528.                             (0<<vPMack)|\            ; Power mgr handshake acknowledge is an input
  529.                             (0<<vTestJ)|\            ; Test jumper is an input
  530.                             (1<<vSync)|\            ; Synchronous modem is an output
  531.                             (1<<vDriveSel)|\        ; int drive select is an output
  532.                             (1<<vHeadSel)|\            ; head select line is an output
  533.                             (0<<vStereo)|\            ; Stereo sound detect is an input
  534.                             (1<<vSndEnb)            ; sound enable is an output
  535.  
  536. vBInit             EQU         (1<<vPMreq)|\            ; Power mgr handshake not requesting
  537.                             (1<<vPMack)|\            ; Power mgr handshake acknowledge is an input
  538.                             (1<<vTestJ)|\            ; Test jumper is an input
  539.                             (1<<vSync)|\            ; Synchronous modem disabled (active low)
  540.                             (1<<vDriveSel)|\        ; lower floppy drive selected
  541.                             (0<<vHeadSel)|\            ; head select line is an output
  542.                             (1<<vStereo)|\            ; Stereo sound detect is an input
  543.                             (1<<vSndEnb)            ; sound is disabled
  544.  
  545. vBufD             EQU         vBufB                     ; disk head select is buffer B
  546.  
  547.  
  548. ; === Hardware Base Addresses ===
  549.  
  550. VBase             EQU         $F70000                   ; VIA base address
  551. AVBufA            EQU         VBase+vBufA             ; VIA buffer A
  552. AVBufB            EQU         VBase+vBufB              ; VIA buffer B
  553.  
  554. SCCRBase          EQU         $FD0000                   ; SCC base read address
  555. SCCWBase          EQU         $FD8000                   ; SCC base write address
  556. sccWrite          EQU         SCCWBase-SCCRBase        ; general offset for write from read
  557.  
  558. SCSIRd            EQU         $F90000                   ; base address of SCSI interface - READ
  559. SCSIWr            EQU         $F90001                   ; base address of SCSI interface - WRITE
  560. MacSCSIBase       EQU         $F90000                   ; base address of SCSI READ interface
  561. MacSCSIDMA        EQU         $F90200                   ; base address of SCSI DMA
  562. MacSCSIHsk        EQU         $F90200                   ; base address of SCSI handshake
  563. wrOffs            EQU         SCSIWr-SCSIRd            ; write addrs are +1 to the read base
  564.  
  565. SndBase           EQU         $FB0000                   ; sound chip's base address
  566.  
  567. MapperBase        EQU         $FC0000                   ; Mapper RAM base address
  568.  
  569. RAMconfigBase     EQU         $FE0200                   ; Internal/external RAM control register
  570. RAMconfigInit    EQU            $0006                    ; Init test register                        <v2.6>
  571.  
  572. ; === Video Parameters ===
  573.  
  574. ScreenLow         EQU         $FA8000                   ; top of screen screen address
  575. hcVideoSize       EQU         $8000                     ; 32k of video memory
  576. HcVideoStart      EQU         ScreenLow
  577. HcVideoEnd        EQU         HcVideoStart+hcVideoSize
  578. NTSCMaxX        EQU            512                        ; NTSC output is narrow
  579. NTSCOffset        EQU            8                        ;  and centered
  580. LCDmode            EQU            0                        ; Normal built in screen
  581. Mac2mode        EQU            1                        ; Custom screen for Mac2
  582. NTSCmode        EQU            2                        ; NTSC output
  583.  
  584. ; === System Software Information ===
  585. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  586. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  587. bufWorldSize      EQU         snd2MemTop                ; total size of the BufPtr world
  588. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  589.  
  590.  
  591.                   ELSEIF      onMac16 THEN
  592. ;===================================================;
  593. ;    Universal 16 bit Macintosh Hardware Information    ;
  594. ;===================================================;
  595.  
  596.  
  597. ; === Interrupt Masks ===
  598. hiIntMask         EQU         $0300                    ; programmer switch only
  599. sccIntMask        EQU         $0200                     ; SCC interrupt Level        <1.5>
  600. sccEnblMask       EQU         $F9FF                     ; mask to enable SCC interrupts
  601. viaIntMask        EQU         $0100                     ; mask for VIA (and VBL) interrupts
  602. loIntMask         EQU         $0100
  603.  
  604. ; === VIA1 BUFFER A ===
  605. vSound            EQU         $7                        ; sound volume bits (0..2)
  606. vSndPg2           EQU         3                         ; select sound page 2 if 0
  607. ;vSync             EQU         3                         ; Synchronous modem
  608. vOverlay          EQU         4                         ; overlay bit (overlay when 1)
  609. ;vDriveSel         EQU         4                         ; int drive select (lower drive when 1)
  610. ;vHeadSel          EQU         5                         ; head select line for Sony
  611. vPage2            EQU         6                         ; select video page 2 if 0
  612. ;vSCCWrReq         EQU         7                         ; SCC write/request line
  613.  
  614.  
  615. ; === VIA1 BUFFER B ===
  616. vRTCData          EQU         0                         ; real time clock data
  617. vRTCClk           EQU         1                         ; real time clock clock pulses
  618. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  619. vSW               EQU         3                         ; mouse switch (0 when down)
  620. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  621. vX2               EQU         4                         ; mouse X level
  622. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  623. vY2               EQU         5                         ; mouse Y level
  624. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  625. vH4               EQU         6                         ; horizontal sync
  626. vSCSIMask         EQU         6                         ; SCSI IRQ mask
  627. vSndEnb           EQU         7                         ; /sound enable (reset when 1)
  628.  
  629. vPMreq            EQU         0                         ; Power manager handshake request
  630. vPMack            EQU         1                         ; Power manager handshake acknowledge
  631. vTestJ            EQU         2                         ; Test jumper
  632. ;vSync             EQU         3                         ; Synchronous modem
  633. ;vDriveSel         EQU         4                         ; int drive select (lower drive when 1)
  634. ;vHeadSel          EQU         5                         ; head select line for Sony
  635. vStereo           EQU         6                         ; Stereo sound enable
  636. ;vSCCWrReq         EQU         7                         ; SCC write/request line        (input)
  637.  
  638. ; === VIA1 BUFFER A/B ===
  639. vSync             EQU         3                         ; Synchronous modem                        <3.1>
  640. vDriveSel         EQU         4                         ; int drive select (lower drive when 1)    <3.1>
  641. vHeadSel          EQU         5                         ; head select line for Sony                <3.1>
  642. vSCCWrReq         EQU         7                         ; SCC write/request line                <3.1>
  643.  
  644. ; === Hardware Base Addresses ===
  645.  
  646. wrOffs            EQU         1                        ; write addrs are +1 to the read base
  647.  
  648. ; === System Software Information ===
  649. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  650.  
  651.                   ELSEIF      onMac32 THEN
  652. ;===================================================;
  653. ;    Universal 32 bit Macintosh Hardware Information    ;
  654. ;===================================================;
  655.  
  656. machine           EQU         6                        ; for patch file $067C                    <3.5>
  657.  
  658. ; === Interrupt Masks ===
  659. hiIntMask         EQU         $0700                    ; programmer switch only
  660. pwrOffEnbl        EQU         $2500                    ; mask to allow poweroff interrupts
  661. sccIntMask        EQU         $0400                    ; SCC interrupt level
  662. sccEnblMask       EQU         $FBFF                    ; mask to enable SCC interrupts
  663. slotIntMask       EQU         $0200                       ; slot's interrupt level    <v1.4><1.9>
  664. viaIntMask        EQU         $0100                    ; VIA1 interrupt level
  665. loIntMask         EQU         $0100
  666.  
  667. ; === VIA1 BUFFER A ===
  668. vSound            EQU         $7                        ; sound volume bits (0..2)    (output)
  669. vTestJ            EQU         0                         ; Burn In Test jumper        (input)
  670. vCpuId0            EQU            1                        ; CPU Identification bit 0    (input)
  671. vCpuId1            EQU            2                        ; CPU Identification bit 1    (input)
  672. vSync             EQU         3                         ; Synchronous modem
  673. vOverlay          EQU         4                         ; overlay bit (overlay when 1)
  674. vCpuId2            EQU            4                        ; CPU Identification bit 2
  675. vHeadSel          EQU         5                         ; head select line for Sony
  676. vRev8Bd           EQU         6                         ; =0 for rev 8 board
  677. vCpuId3            EQU            6                        ; CPU Identification bit 3
  678. vSCCWrReq         EQU         7                         ; SCC write/request line
  679.  
  680. ; === VIA1 BUFFER B ===
  681. vRTCData          EQU         0                         ; real time clock data
  682. v0reserved        EQU            0                        ; reserved bit in Erickson                <6>
  683. vRTCClk           EQU         1                         ; real time clock clock pulses
  684. v1reserved        EQU            1                        ; reserved bit in Erickson                <6>
  685. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  686. v2reserved        EQU            2                        ; reserved bit in Erickson                <6>
  687. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  688. xcvrsesbit        EQU            3                        ; Egret transceiver session bit            <6>
  689. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  690. viafullbit        EQU            4                        ; Egret via full bit                    <6>
  691. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  692. syssesbit        EQU            5                        ; Egret system session bit                <6>
  693. vPGCEnb            EQU            6                        ; Parity Generator/Checker enable (0 for enable)
  694. v6reserved        EQU            6                        ; reserved bit in Erickson                <6>
  695. vPGCErr            EQU            7                        ; Parity Generator/Checker error    (input)
  696. v7reserved        EQU            7                        ; reserved bit in Erickson                <6>
  697. vSndEnb           EQU         7                         ; /sound enable (reset when 1)        (output)
  698.  
  699.  
  700. ; === Hardware Base Addresses ===
  701.  
  702. WrOffs            EQU            0                        ; SCSI write addrs are same as read base
  703.  
  704. MskIOP1            EQU            1                        ; IOP 1 (SWIM) is level 1 interrupt
  705. MskVIA1            EQU            1                        ; VIA 1 is level 1
  706. MskADB            EQU            1                        ; ADB is level 1
  707. Msk60Hz            EQU            1                        ; 60 Hz is level 1
  708. MskSCSI            EQU            2                        ; SCSI is level 2
  709. MskSound        EQU            2                        ; sound is level 2                        <4.5>
  710. MskSlots        EQU            2                        ; slots are level 2 interrupts
  711. MskRTC            EQU            3                        ; RTC is level 3
  712. MskIOP0            EQU            4                        ; IOP 0 (& SCC chip) is level 4
  713. MskPwrOff        EQU            6                        ; Poweroff button is level 6
  714. MskNMI            EQU            7                        ; NMI switch is level 7
  715.  
  716. ; === System Software Information ===
  717. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  718. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  719. bufWorldSize      EQU         snd2MemTop                ; total size of the BufPtr world
  720. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  721.  
  722.  
  723.                   ELSEIF      onHafMac THEN
  724. ;===================================;
  725. ;    Mac IIci Hardware Information    ;
  726. ;===================================;
  727.  
  728. machine           EQU         6
  729.  
  730. ; === Interrupt Masks ===
  731. hiIntMask         EQU         $0700                     ; programmer switch only
  732. pwrOffEnbl        EQU         $2500                     ; mask to allow poweroff interrupts
  733. sccIntMask        EQU         $0400                     ; SCC interrupt level
  734. sccEnblMask       EQU         $FBFF                     ; mask to enable SCC interrupts
  735. via2IntMask       EQU         $0200                     ; VIA2 interrupt level        <v1.4><1.9>
  736. slotIntMask       EQU         via2IntMask               ; slot's interrupt level    <v1.4><1.9>
  737. viaIntMask        EQU         $0100                     ; VIA1 interrupt level
  738. loIntMask         EQU         $0100
  739.  
  740. ; === VIA1 BUFFER A ===
  741. vSound            EQU         $7                        ; sound volume bits (0..2)    (output)
  742. vTestJ            EQU         0                         ; Burn In Test jumper        (input)
  743. vCpuId0            EQU            1                        ; CPU Identification bit 0    (input)
  744. vCpuId1            EQU            2                        ; CPU Identification bit 1    (input)
  745. vSync             EQU         3                         ; Synchronous modem
  746. vCpuId2            EQU            4                        ; CPU Identification bit 2
  747. vHeadSel          EQU         5                         ; head select line for Sony
  748. vCpuId3            EQU            6                        ; CPU Identification bit 3
  749. vSCCWrReq         EQU         7                         ; SCC write/request line
  750.  
  751. vAOut             EQU         (vSound)|\                ; sound volume bits are outputs
  752.                             (1<<vSync)|\            ; Synchronous modem is an output
  753.                             (0<<vCpuId2)|\            ; CPU Identification bit 2 is an input
  754.                             (1<<vHeadSel)|\            ; head select line is an output
  755.                             (0<<vCpuId3)|\            ; CPU Identification bit 3 is an input
  756.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  757.  
  758. vAInit             EQU         (1)|\                    ; sound volume level initially 1
  759.                             (0<<vSync)|\            ; Synchronous modem disabled (active high)
  760.                             (0<<vCpuId2)|\            ; CPU Identification bit 2 is an input
  761.                             (1<<vHeadSel)|\            ; head select line is an output
  762.                             (0<<vCpuId3)|\            ; CPU Identification bit 3 is an input
  763.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  764.  
  765. vBufD             EQU         vBufA                     ; disk head select is buffer A
  766.  
  767.  
  768. ; === VIA1 BUFFER B ===
  769. vRTCData          EQU         0                         ; real time clock data
  770. vRTCClk           EQU         1                         ; real time clock clock pulses
  771. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  772. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  773. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  774. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  775. vPGCEnb            EQU            6                        ; Parity Generator/Checker enable (0 for enable)
  776. vPGCErr            EQU            7                        ; Parity Generator/Checker error    (input)
  777. vSndEnb           EQU         7                         ; /sound enable (reset when 1)        (output)
  778.  
  779. vBOut             EQU         (1<<vRTCData)|\            ; real time clock data initially an output
  780.                             (1<<vRTCClk)|\            ; real time clock clock is an output
  781.                             (1<<vRTCEnb)|\            ; clock enable is an output
  782.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  783.                             (1<<vFDesk1)|\            ; FDB state bit 0 is an output
  784.                             (1<<vFDesk2)|\            ; FDB state bit 1 is an output
  785.                             (1<<vPGCEnb)|\            ; PGC enable is an output
  786.                             (1<<vSndEnb)            ; sound enable is an output
  787.  
  788. vBInit             EQU         (1<<vRTCData)|\            ; real time clock data is one
  789.                             (1<<vRTCClk)|\            ; real time clock clock is high
  790.                             (1<<vRTCEnb)|\            ; clock initially disabled
  791.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  792.                             (1<<vFDesk1)|\            ; FDB state bit 0 is initially state 3
  793.                             (1<<vFDesk2)|\            ; FDB state bit 1 is initially state 3
  794.                             (1<<vPGCEnb)|\            ; Parity Checking is initially disabled
  795.                             (1<<vSndEnb)            ; sound is disabled
  796.  
  797.  
  798. ; === RBV BUFFER B ===
  799. RvBInit            EQU            (1<<RvCDis)|\            ; cache disabled    <3.3>
  800.                             (1<<RvBusLk)|\            ; Bus unlocked
  801.                             (1<<RvPowerOff)|\        ; Power on
  802.                             (1<<RvCFlush)|\            ; don't flush cache
  803.                             (0<<RvTM1A)|\            ; NuBus timeout bits are inputs
  804.                             (0<<RvTM0A)|\            ; NuBus timeout bits are inputs
  805.                             (0<<RvSndExt)|\            ; sound/speaker mode is an input
  806.                             (1<<RvPGCTest)            ; generate correct parity
  807.  
  808.  
  809. ; === Hardware Base Addresses ===
  810.  
  811. VBase             EQU         $50F00000               ; VIA base address
  812. AVBufA            EQU         VBase+vBufA             ; VIA buffer A
  813. AVBufB            EQU         VBase+vBufB              ; VIA buffer B
  814.  
  815. SCCRBase          EQU         $50F04000               ; SCC base read address
  816. SCCWBase          EQU         $50F04000               ; SCC base write address
  817. sccWrite          EQU         SCCWBase-SCCRBase        ; general offset for write from read
  818.  
  819. NewSCSIBase       EQU         $50F10000                 ; rev8 base addr SCSI interface
  820. NewSCSIDMA        EQU         $50F12000                 ; rev8 base addr SCSI DMA (corrected)
  821. NewSCSIHsk        EQU         $50F06000                 ; rev8 base addr SCSI handshake
  822. MacSCSIBase       EQU         $50F10000                 ; base addr SCSI interface
  823. MacSCSIDMA        EQU         $50F12000                 ; base addr SCSI DMA
  824. MacSCSIHsk        EQU         $50F06000                 ; base addr SCSI handshake
  825. wrOffs            EQU         0                         ; write addrs are same as read base
  826.  
  827. SndBase            EQU         $50F14000                 ; sound chip's base address
  828.  
  829. ; === Video Parameters ===
  830.  
  831. RBVBase            EQU            $50F26000                ; RBV base address                <v1.4><1.4>
  832. vDACBase        EQU            $50F24000                ; base of clut
  833.  
  834. ; === System Software Information ===
  835. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  836. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  837. bufWorldSize      EQU         snd2MemTop                ; total size of the BufPtr world
  838. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  839.  
  840.                   ELSEIF      onNuMac THEN
  841. ;=======================================================;
  842. ;    Macintosh II, IIx, IIcx, SE30 Hardware Information    ;
  843. ;=======================================================;
  844.  
  845. hwCfgBits         EQU         hwCmSCSI++hwCmClock++hwCmFPU++hwCmMMU++hwCmADB
  846. machine           EQU         1
  847. rom85Bits         EQU         $3F                       ; New ROMs, Power Off ability.
  848.  
  849. ; === Interrupt Masks ===
  850. hiIntMask         EQU         $0700                     ; programmer switch only
  851. pwrOffEnbl        EQU         $2500                     ; mask to allow poweroff interrupts
  852. sccIntMask        EQU         $0400                     ; SCC interrupt level
  853. sccEnblMask       EQU         $FBFF                     ; mask to enable SCC interrupts
  854. via2IntMask       EQU         $0200                     ; VIA2 interrupt level        <v1.4><1.9>
  855. slotIntMask       EQU         via2IntMask               ; slot's interrupt level    <v1.4><1.9>
  856. viaIntMask        EQU         $0100                     ; VIA1 interrupt level
  857. loIntMask         EQU         $0100
  858.  
  859. ; === VIA1 BUFFER A ===
  860. vSound            EQU         $7                        ; sound volume bits (0..2)    (output)
  861. vSync             EQU         3                         ; Synchronous modem
  862. vOverlay          EQU         4                         ; overlay bit (overlay when 1)
  863. vHeadSel          EQU         5                         ; head select line for Sony
  864. vRev8Bd           EQU         6                         ; =0 for rev 8 board
  865. vSCCWrReq         EQU         7                         ; SCC write/request line
  866.  
  867. vAOut             EQU         (vSound)|\                ; sound volume bits are outputs
  868.                             (1<<vSync)|\            ; Synchronous modem is an output
  869.                             (1<<vOverlay)|\            ; overlay bit is an output
  870.                             (1<<vHeadSel)|\            ; head select line is an output
  871.                             (0<<vRev8Bd)|\            ; board ID is an input
  872.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  873.  
  874. vAInit             EQU         (1)|\                    ; sound volume level initially 1
  875.                             (0<<vSync)|\            ; Synchronous modem disabled (active high)
  876.                             (0<<vOverlay)|\            ; overlay is turned off
  877.                             (0<<vHeadSel)|\            ; head select line is an output
  878.                             (0<<vRev8Bd)|\            ; board ID is an input
  879.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  880.  
  881. vBufD             EQU         vBufA                     ; disk head select is buffer A
  882.  
  883.  
  884. ; === VIA1 BUFFER B ===
  885. vRTCData          EQU         0                         ; real time clock data
  886. vRTCClk           EQU         1                         ; real time clock clock pulses
  887. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  888. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  889. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  890. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  891. ;                EQU            6                        ; unused
  892. vSndEnb           EQU         7                         ; /sound enable (reset when 1)        (output)
  893.  
  894. vBOut             EQU         (1<<vRTCData)|\            ; real time clock data initially an output
  895.                             (1<<vRTCClk)|\            ; real time clock clock is an output
  896.                             (1<<vRTCEnb)|\            ; clock enable is an output
  897.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  898.                             (1<<vFDesk1)|\            ; FDB state bit 0 is an output
  899.                             (1<<vFDesk2)|\            ; FDB state bit 1 is an output
  900.                             (1<<vSndEnb)            ; sound enable is an output
  901.  
  902. vBInit             EQU         (1<<vRTCData)|\            ; real time clock data is one
  903.                             (1<<vRTCClk)|\            ; real time clock clock is high
  904.                             (1<<vRTCEnb)|\            ; clock initially disabled
  905.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  906.                             (1<<vFDesk1)|\            ; FDB state bit 0 is initially state 3
  907.                             (1<<vFDesk2)|\            ; FDB state bit 1 is initially state 3
  908.                             (0<<vSndEnb)            ; sound is enabled
  909.  
  910.  
  911. ; === VIA2 BUFFER A ===
  912. v2AOut            EQU         (0<<v2IRQ1)|\             ; slot 1 interrupt is an input
  913.                   (0<<v2IRQ2)|\                         ; slot 2 interrupt is an input
  914.                   (0<<v2IRQ3)|\                         ; slot 3 interrupt is an input
  915.                   (0<<v2IRQ4)|\                         ; slot 4 interrupt is an input
  916.                   (0<<v2IRQ5)|\                         ; slot 5 interrupt is an input
  917.                   (0<<v2IRQ6)|\                         ; slot 6 interrupt is an input
  918.                   (1<<v2RAM0)|\                         ; ram size bit 0 is an output
  919.                   (1<<v2RAM1)                           ; ram size bit 1 is an output
  920.  
  921. v2AInit            EQU            (0<<v2IRQ1)|\            ; slot 1 interrupt is an input
  922.                             (0<<v2IRQ2)|\            ; slot 2 interrupt is an input
  923.                             (0<<v2IRQ3)|\            ; slot 3 interrupt is an input
  924.                             (0<<v2IRQ4)|\            ; slot 4 interrupt is an input
  925.                             (0<<v2IRQ5)|\            ; slot 5 interrupt is an input
  926.                             (0<<v2IRQ6)|\            ; slot 6 interrupt is an input
  927.                             (0<<v2RAM0)|\            ; or ram size bit 0 with 0
  928.                             (0<<v2RAM1)                ; or ram size bit 1 with 0
  929.  
  930.  
  931. ; === VIA2 BUFFER B ===
  932. v2BOut            EQU            (0<<v2CDis)|\            ; cache disabled    <3.3>
  933.                   (0<<v2BusLk)|\                        ; Bus unlocked
  934.                   (0<<v2PowerOff)|\                     ; Power on
  935.                   (0<<vFC3)|\                           ; don't flush cache
  936.                   (0<<v2TM1A)|\                         ; NuBus timeout bits are inputs
  937.                   (0<<v2TM0A)|\                         ; NuBus timeout bits are inputs
  938.                   (0<<v2SndExt)|\                       ; sound/speaker mode is an input
  939.                   (1<<v2VBL)                            ; 60Hz pseudo VBL output
  940.  
  941. v2BInit            EQU            (1<<v2CDis)|\            ; cache disabled (input when not in use)    <3.3>
  942.                             (0<<v2BusLk)|\            ; Bus unlocked    (input when not in use)
  943.                             (1<<v2PowerOff)|\        ; Power on    (input when not in use)
  944.                             (0<<vFC3)|\                ; don't flush cache    (input when not in use)
  945.                             (0<<v2TM1A)|\            ; NuBus timeout bits are inputs
  946.                             (0<<v2TM0A)|\            ; NuBus timeout bits are inputs
  947.                             (0<<v2SndExt)|\            ; sound/speaker mode is an input
  948.                             (0<<v2VBL)                ; 60Hz pseudo VBL output
  949.  
  950.  
  951. ; === Hardware Base Addresses ===
  952.  
  953. VBase             EQU         $50F00000                 ; VIA base address
  954. AVBufA            EQU         VBase+vBufA               ; VIA buffer A
  955. AVBufB            EQU         VBase+vBufB               ; VIA buffer B
  956.  
  957. VBase2            EQU         $50F02000                 ; VIA2 base address                <v1.4>
  958.  
  959. SCCRBase          EQU         $50F04000                 ; SCC base read address
  960. SCCWBase          EQU         $50F04000                 ; SCC base write address
  961. sccWrite          EQU         SCCWBase-SCCRBase         ; general offset for write from read
  962.  
  963. NewSCSIBase       EQU         $50F10000                 ; rev8 base addr SCSI interface
  964. NewSCSIDMA        EQU         $50F12000                 ; rev8 base addr SCSI DMA (corrected)
  965. NewSCSIHsk        EQU         $50F06000                 ; rev8 base addr SCSI handshake
  966. MacSCSIBase       EQU         $50F10000                 ; base addr SCSI interface
  967. MacSCSIDMA        EQU         $50F12000                 ; base addr SCSI DMA
  968. MacSCSIHsk        EQU         $50F06000                 ; base addr SCSI handshake
  969. wrOffs            EQU         0                         ; write addrs are same as read base
  970.  
  971. SndBase           EQU         $50F14000                 ; sound chip's base address
  972.  
  973. ; === System Software Information ===
  974. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  975. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  976. bufWorldSize      EQU         snd2MemTop                ; total size of the BufPtr world
  977. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  978.  
  979.                   ENDIF
  980.  
  981.  
  982. ;----------
  983. ; Deep Shit Rectangle info
  984. ;----------
  985.  
  986. dsRectTL          EQU         (64<<16)+32               ; top left = 64,32
  987. dsRectBR          EQU         (190<<16)+480             ; bottom right = 190,480
  988. dsRectHei         EQU         (dsRectBR**$FFFF0000)-(dsRectTL**$FFFF0000)>>16
  989. dsRectLen         EQU         (dsRectBR**$FFFF)-(dsRectTL**$FFFF)
  990.  
  991.  
  992.                   IF          onAnything THEN
  993.  
  994. ;----------
  995. ; System Error, ROM Based Debugger Nub, MicroBug Equates
  996. ;----------
  997.  
  998. seVars            EQU         seRegs                    ; start of system error data space (wrap city)
  999. seVSize           EQU         128                       ; # of bytes in space
  1000. seD0              EQU         seVars                    ; loc of saved reg D0
  1001. seA0              EQU         seD0+32                   ; loc of saved reg A0
  1002. seA7              EQU         seA0+28                   ; loc of saved reg A7
  1003. sePC              EQU         seA7+4                    ; loc of saved PC
  1004. seSR              EQU         sePC+4                    ; loc of saved SR
  1005. seAccess          EQU         seSR+2                    ; PC address during bus/address error
  1006. seCmdSize         EQU         seAccess+4                ; # of bytes of parameters passed in _debugger call
  1007. se000BE           EQU         seCmdSize+2               ; 8 bytes of bus error info for 68000
  1008. seLastVar         EQU         se000BE+8                 ; last var in System Error data space
  1009.  
  1010.  
  1011. ;-----
  1012. ; ROM based debugger nub
  1013. ;-----
  1014.  
  1015. rdPort            EQU         seLastVar                 ; Number of port currently in use (0 => no link, 1 => A, 2 => B)
  1016. rdCode            EQU         rdPort+2                  ; Ptr to code download buffer.
  1017. rdAtrap           EQU         rdCode+4                  ; Saved Rom Atrap handler
  1018. rdLowTrap         EQU         rdAtrap+4                 ; low value for trap handling
  1019. rdHiTrap          EQU         rdLowTrap+2               ; high value for trap handling
  1020. rdResult          EQU         rdHiTrap+2                ; result of executing down-loaded code, etc. (16 bytes)
  1021. rdEnd             EQU         rdResult+16               ; end of vars
  1022.  
  1023.  
  1024. ;-----
  1025. ; Microbug
  1026. ;-----
  1027.  
  1028. ; NOTE: Keep mbDotAddr immediately before mBlocAddr
  1029.  
  1030. mbBufSize         EQU         34
  1031. mbBuffer          EQU         seLastVar                 ; buffer for input
  1032. mbSign            EQU         mbBuffer+mbBufSize        ; ST => negative sign during conversion
  1033. mbDotAddr         EQU         mbSign+2                  ; saved address
  1034. mBlocAddr         EQU         mbDotAddr+4               ; saved location
  1035.  
  1036. ;----------
  1037. ; Timing constants
  1038. ;----------
  1039.  
  1040. VIAClockHz        EQU            783360                    ; VIA clock rate is 783360 Hz.        <2.8>
  1041. nTicks            EQU         VIAClockHz/1000           ; VIA timer ticks per msec
  1042. oneSecTicks       EQU         60                        ; ticks, of course
  1043. TimeSCSIDB        EQU            $0B24                    ; DBRAs & SCSI access per millisecond <1.9>
  1044.  
  1045. ramChk            EQU         1024                      ; Amount of memory tested for stack.
  1046.  
  1047.                   ENDIF
  1048.  
  1049.                   ENDIF                                 ; {HWNonPortable}
  1050.  
  1051.  
  1052.     ENDIF    ; ...already included